<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace app\assets;

use yii\web\AssetBundle;

/**
 * Main application asset bundle.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css'
    ];
    public $js = [
         'statics/js/jquery-3.2.1.min.js',
         'https://cdn.jsdelivr.net/npm/vue',
         'statics/js/swiper-3.3.1.min.js',
          'statics/js/video.min.js',
        'https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js'
    ];

//     js 文件在头部加载
    public $jsOptions = [
        'position' => \yii\web\View::POS_HEAD
    ];
    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
    ];
    //    按需加载JS方法，加载顺序在最后
    public static function addScript($view, $jsfile) {
        $view->registerJsFile($jsfile, [AppAsset::className(), 'depends' => 'app\assets\AppAsset']);
    }
    //    按需加载css方法，加载顺序在最后
    public static function addCss($view, $cssfile) {
        $view->registerCssFile($cssfile, [AppAsset::className(), 'depends' => 'app\assets\AppAsset']);
    }

}
